import os


def get_output_absolute_path():

    # 获取当前文件所在目录的上级目录
    cur_dir = os.path.dirname(os.path.abspath(__file__))
    root_dir = os.path.dirname(os.path.abspath(cur_dir))
    dataset_dir = root_dir + '/output/'
    return dataset_dir

def get_specific_file_name_by_spec_str_list(path_f, spec_str_list ):
    out_file_name_list=[]
    for file_name in os.listdir(path_f):
        is_this_file=True
        for spec_str in spec_str_list:
            if spec_str not in file_name:
                is_this_file=False
        if is_this_file==True:
            out_file_name_list.append(file_name)
    if len(out_file_name_list)==1:
        return out_file_name_list[0]
    elif len(out_file_name_list)>1 or len(out_file_name_list)==0:
        print("multi_file_name wrong!")
        exit(-1)
    else:
        return None